package com.leon.datalink.core.persistence.event;

/**
 * 节点启动事件
 * 当节点启动时触发
 * 
 * @author leon
 */
public class NodeStartedEvent implements NodeEvent {
    
    private String nodeId;
    private long timestamp;
    private String actorClass;
    
    public NodeStartedEvent() {
        // 默认构造函数，用于序列化
    }
    
    public NodeStartedEvent(String nodeId) {
        this.nodeId = nodeId;
        this.timestamp = System.currentTimeMillis();
    }
    
    @Override
    public String getNodeId() {
        return nodeId;
    }
    
    @Override
    public long getTimestamp() {
        return timestamp;
    }
    
    @Override
    public String getEventType() {
        return "NODE_STARTED";
    }
    
    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }
    
    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public String getActorClass() {
        return actorClass;
    }

    public void setActorClass(String actorClass) {
        this.actorClass = actorClass;
    }
    
    @Override
    public String toString() {
        return "NodeStartedEvent{" +
                "nodeId='" + nodeId + '\'' +
                ", timestamp=" + timestamp +
                '}';
    }
}
